package edu.tgc.entity.system;

import java.io.Serializable;

import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@MappedSuperclass
public abstract class AbstractAuditableEntity<U, ID extends Serializable> extends AbstractAuditableDateEntity<ID> {

    private static final long serialVersionUID = -6166121171332820625L;

    @JsonIgnoreProperties(value = { "createUser", "lastModifyUser", "createTime", "lastModifyTime", "dept", "description", "enabled", "ip", "username", "sort", "address", "dutyStatus", "education", "email", "hireDate", "idNo", "leaveDate", "major",
            "qq", "sex", "status", "telphone" })
    protected U createUser;
    @JsonIgnoreProperties(value = { "createUser", "lastModifyUser", "createTime", "lastModifyTime", "dept", "description", "enabled", "ip", "username", "sort", "address", "dutyStatus", "education", "email", "hireDate", "idNo", "leaveDate", "major",
            "qq", "sex", "status", "telphone" })
    protected U lastModifyUser;

    @CreatedBy
    @ManyToOne
    public U getCreateUser() {
        return createUser;
    }

    public void setCreateUser(U createUser) {
        this.createUser = createUser;
    }

    @LastModifiedBy
    @ManyToOne
    public U getLastModifyUser() {
        return lastModifyUser;
    }

    public void setLastModifyUser(U lastModifyUser) {
        this.lastModifyUser = lastModifyUser;
    }

    public AbstractAuditableEntity() {
        super();
    }

    public AbstractAuditableEntity(ID id) {
        super(id);
    }

}